///*
// * To change this license header, choose License Headers in Project Properties.
// * To change this template file, choose Tools | Templates
// * and open the template in the editor.
// */
//package com.sinosoft.gateway.filter;
//
//import org.springframework.cloud.gateway.filter.GatewayFilter;
//import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFactory;
//import org.springframework.http.server.reactive.ServerHttpRequest;
//import org.springframework.stereotype.Component;
//import org.springframework.web.server.ServerWebExchange;
//
///**
// *
// * @author root
// */
//@Component
//public class RequestPathGatewayFilterFactory extends AbstractGatewayFilterFactory {
//
//    @Override
//    public GatewayFilter apply(Object config) {
//        return (exchange, chain) -> {
//            ServerHttpRequest request0 = exchange.getRequest();
//
//            String path0 = request0.getPath().value();
//            String code = path0.substring(path0.lastIndexOf("/") + 1, path0.length());
//            String path1 = path0.substring(0, path0.lastIndexOf("/"));
//            String path2 = path1 + "/access";
//            ServerHttpRequest request1 = request0.mutate().header("CODEs", code).path(path2).build();
//            ServerWebExchange newExchange = exchange.mutate().request(request1).build();
//
//            return chain.filter(newExchange);
//
//        };
//    }
//
//}
